package com.zhaohanlin.start;

import org.junit.Test;

import javax.naming.ServiceUnavailableException;



/**
 * @author zhaohanlin
 */

    public class InitBlockTest {

        static class Dog {

            /**
             * 狗类构造器
             */
            public Dog() {
                this("25");
                System.out.println(1);
            }

            /**
             * 狗类构造器
             */
            public Dog(int age) {

                System.out.println(2);
            }

            /**
             * 狗类构造器
             */
            public   Dog(String name) {
                this(25);
                System.out.println(3);
            }

        {
            System.out.println("我是动态块01");
        }

        {
            System.out.println("我是动态块02");
        }

        static {
            System.out.println("我是静态块01");
        }

        static {
            System.out.println("我是静态块02");
        }

        }

        @Test
        public void constructor() {
            new Dog();
            //new Dog();
        }


    }





